import { ApiOauthToken } from '@/common/request/api.js'
const state = {}
const actions = {
	// 登录
	async ActLogin({dispatch,commit},payload){
		const res = await ApioauthToken(payload)
		console.log(res)
		if(res.error_code !== 400){
			uni.setStorageSync('token', res.token_type +' '+res.access_token);
			uni.setStorageSync('refresh_token', res.refresh_token);
			uni.setStorageSync('loginTime', new Date().getTime())
			uni.setStorageSync('userInfo',res);
		}
		return res
	},
}
const mutations ={}
const getters = {}

export default {
	state,
	mutations,
	actions,
	getters
}